import request from '@/utils/request'

/**
 * 新增影片排片
 * @param data
 * @returns {*}
 */
export function addRowPiece(data) {
  return request({
    url: '/ticket-film/api/v1/rms/row-piece',
    method: 'post',
    data: data
  })
}


/**
 * 更新影片排片
 * @param data
 * @returns {*}
 */
export function updateRowPiece(data) {
  return request({
    url: '/ticket-film/api/v1/rms/row-piece',
    method: 'put',
    data: data
  })
}

/**
 * 删除影片排片
 * @param rowPieceId
 * @returns {*}
 */
export function deleteRowPiece(rowPieceId) {
  return request({
    url: '/ticket-film/api/v1/rms/row-piece?rowPieceId='+rowPieceId,
    method: 'delete'
  })
}

/**
 * 获取某场次座位售出情况
 * @param rowPieceId
 * @returns {*}
 */
export function listSeatsOfRowPiece(rowPieceId) {
  return request({
    url: '/ticket-film/api/v1/rms/outer/row-piece/seats?rowPieceId='+rowPieceId,
    method: 'get'
  })
}

/**
 * 分页获取某影片排片信息，包括影院
 * @param params
 * @returns {*}
 */
export function listRowPiecesOfFilm(params) {
  return request({
    url: '/ticket-film/api/v1/rms/outer/row-piece/cinemas',
    method: 'get',
    params: params
  })
}

/**
 * 分页获取指定影院的排片情况，包括影片
 * @param params
 * @returns {*}
 */
export function listRowPiecesOfCinema(params) {
  return request({
    url: '/ticket-film/api/v1/rms/outer/row-piece/films',
    method: 'get',
    params: params
  })
}

/**
 * 分页获取某影片、某类型影片、某状态影片排片信息
 * @param params
 * @returns {*}
 */
export function filterRowPiecesBy(params) {
  return request({
    url: '/ticket-film/api/v1/rms/outer/row-piece/filterBy',
    method: 'get',
    params: params
  })
}

/**
 * 获取所有影片类型
 * @returns {*}
 */
export function listAllTypes() {
  return request({
    url: '/ticket-film/api/v1/rms/outer/types',
    method: 'get'
  })
}
